package com.sso.service.impl;

import java.util.List;

import com.sso.dao.IDicHumanDao;
import com.sso.entity.DicHuman;
import com.sso.entity.DicSystem;
import com.sso.service.IDicHumanService;

public class DicHumanServiceImpl implements IDicHumanService{
	private IDicHumanDao dicHumanDao;
	
	public IDicHumanDao getDicHumanDao() {
		return dicHumanDao;
	}

	public void setDicHumanDao(IDicHumanDao dicHumanDao) {
		this.dicHumanDao = dicHumanDao;
	}

	@Override
	public void deleteDicHuman(DicHuman human) {
		dicHumanDao.delete(human);
	}

	@Override
	public List<DicHuman> getAllHuman() {
		return dicHumanDao.getAll();
	}

	@Override
	public DicHuman getByHumanId(String HumanID) {
		return dicHumanDao.getById(HumanID);
	}

	@Override
	public List<DicHuman> getByHumanName(String HumanName) {
		return dicHumanDao.findAllByNamedQuery("dh.getHumanByHumanname", HumanName);
	}

	@Override
	public List<DicHuman> getBySystemID(String systemID) {
		return dicHumanDao.findAllByNamedQuery("dh.getHumanBySystem", systemID);
	}


	@Override
	public void saveDicHuman(DicHuman human) {
		dicHumanDao.saveOrUpdate(human);
	}

	

}
